home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / prgtools / prtsut53.zip / SU1SRC.ZIP / FDEMO03.PAS < prev    next >
Pascal/Delphi Source File  |  1995-11-23  |  3KB  |  109 lines

  1. unit Fdemo03;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, DBCtrls, DBTables, DB, Mask, Grids, DBGrids,
  8.   ExtCtrls, Buttons, TabNotBk, PrnWin, CB_Types, DBPrnWin, CB_MFunc;
  9.  
  10. type
  11.   TForm03 = class(TForm)
  12.     TabbedNotebook1: TTabbedNotebook;
  13.     View: TBitBtn;
  14.     Panel1: TPanel;
  15.     DBGrid1: TDBGrid;
  16.     DBEdit1: TDBEdit;
  17.     DBImage1: TDBImage;
  18.     DataSource1: TDataSource;
  19.     Table1: TTable;
  20.     Table1SpeciesNo: TFloatField;
  21.     Table1Category: TStringField;
  22.     Table1Common_Name: TStringField;
  23.     Table1SpeciesName: TStringField;
  24.     Table1Lengthcm: TFloatField;
  25.     Table1Length_In: TFloatField;
  26.     Table1Notes: TMemoField;
  27.     Table1Graphic: TGraphicField;
  28.     DBMemo1: TDBMemo;
  29.     Exit: TBitBtn;
  30.     Memo1: TMemo;
  31.     Shape1: TShape;
  32.     Image1: TImage;
  33.     Both: TBitBtn;
  34.     BothBorders: TBitBtn;
  35.     Memo2: TMemo;
  36.     DBPrintWin1: TDBPrintWin;
  37.     procedure ViewClick(Sender: TObject);
  38.     procedure ExitClick(Sender: TObject);
  39.     procedure BothClick(Sender: TObject);
  40.     procedure BothBordersClick(Sender: TObject);
  41.   private
  42.     { Private declarations }
  43.   public
  44.     { Public declarations }
  45.   end;
  46.  
  47. var
  48.   Form03: TForm03;
  49.  
  50. implementation
  51.  
  52. {$R *.DFM}
  53.  
  54. procedure TForm03.ViewClick(Sender: TObject);
  55. begin
  56.     DBPrintWin1.BeginPrint;
  57.    DBPrintWin1.DrawWindow(2,poCenter,TabbedNotebook1);
  58.    DBPrintWin1.EndPrint;
  59. end;
  60.  
  61. procedure TForm03.ExitClick(Sender: TObject);
  62. begin
  63.     Close;
  64. end;
  65.  
  66. procedure TForm03.BothClick(Sender: TObject);
  67. var
  68.     Saved: string;
  69. begin
  70.    Saved := TabbedNotebook1.ActivePage;
  71.    DBPrintWin1.Orientation := Portrait;
  72.     DBPrintWin1.BeginPrint;
  73.    TabbedNotebook1.ActivePage := 'Page 1';
  74.    DBPrintWin1.DrawWindow(2,poCenter,TabbedNotebook1);
  75.    TabbedNotebook1.ActivePage := 'Page 2';
  76.    DBPrintWin1.DrawWindow(5,poCenter,TabbedNotebook1);
  77.    DBPrintWin1.EndPrint;
  78.    TabbedNotebook1.ActivePage := Saved;
  79. end;
  80.  
  81. procedure TForm03.BothBordersClick(Sender: TObject);
  82. var
  83.     Saved: string;
  84. begin
  85.     DBPrintWin1.FrameObjects := True;
  86.    Saved := TabbedNotebook1.ActivePage;
  87.     DBPrintWin1.BeginPrint;
  88.  
  89.    { Make visible, print and make invisible }
  90.    Memo2.Visible := True;
  91.    DBPrintWin1.DrawWindow(1,poCenter,Memo2);
  92.    Memo2.Visible := False;
  93.  
  94.    { Select Page to print }
  95.    TabbedNotebook1.ActivePage := 'Page 1';
  96.    DBPrintWin1.DrawWindow(2,poCenter,TabbedNotebook1);
  97.  
  98.    { Select new Page to print }
  99.    TabbedNotebook1.ActivePage := 'Page 2';
  100.    DBPrintWin1.DrawWindow(2+DBPrintWin1.GetControlHeight(TabbedNotebook1),poCenter,TabbedNotebook1);
  101.    DBPrintWin1.EndPrint;
  102.  
  103.    { Select Page that was active previously }
  104.    TabbedNotebook1.ActivePage := Saved;
  105.     DBPrintWin1.FrameObjects := False;
  106. end;
  107.  
  108. end.
  109.